﻿using System.Buffers;
using ePipe;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;

namespace Letter.Net.Sockets;

sealed class TcpSnder : ASocketSnder
{
    public TcpSnder(PipeScheduler scheduler) : base(scheduler)
    {
    }

    public new ValueTask<SocketOperationResult> SendAsync(Socket socket, in ReadOnlySequence<byte> buffers)
    {
        return base.SendAsync(socket, buffers);
    }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    protected override bool SocketSndOperationAsync(Socket socket)
    {
        return socket.SendAsync(this);
    }
}